import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//1.引入element-plus组件库存与其样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//2.引入element-plus图标库，并起别名为ElementPlusIconsVue
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)/*创建vue实力，并起名为app*/
//3+将导入的图标变为键值对数组对象，并一次遍历取出每一个图标组件[key,component]
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    //4.将当前遍历道德图标组件全局注册为vue实例的全局自建
    app.component(key, component)
}
//5.为vue实例应用element-plus组件库 并挂载到#app元素上
app.use(ElementPlus).use(store).use(router).mount('#app')
